import request from '../../utils/request.js'

// 新增商机
export const addOpportunity = (data: any) => {
    return request({ url: `/tienchin/business`, method: "POST", data: data })
}


// 更新商机
export const updateOpportunity = (data: any) => {
    return request({ url: `/tienchin/business`, method: "PUT", data: data })
}


// 根据渠道id获取对应促销活动列表
export const getActivityListData = (channelId: any, data: any) => {
    return request({ url: `/tienchin/business/activity/${channelId}`, method: "GET", params: data })
}


// 查询所有课程-不分页
export const getAllCurriculum = (data: any) => {
    return request({ url: `/tienchin/business/all_course`, method: "GET", params: data })
}


// 获取所有渠道
export const getAllChannel = (data: any) => {
    return request({ url: `/tienchin/business/channels`, method: "GET", params: data })
}


// 根据类型查询课程
export const getTypeChannel = (type: any, data: any) => {
    return request({ url: `/tienchin/business/course/${type}`, method: "GET", params: data })
}


// 商机跟进
export const businessFollowup = (data: any) => {
    return request({ url: `/tienchin/business/follow`, method: "POST", data: data })
}


// 查询所有商机列表
export const getAllBusinessLsit = (data: any) => {
    return request({ url: `/tienchin/business/list`, method: "GET", params: data })
}


// 根据商机ID查询一个商机的摘要信息
export const getIdAbstract = (businessId: any, data: any) => {
    return request({ url: `/tienchin/business/summary/${businessId}`, method: "GET", params: data })
}


// 删除商机(可多个)
export const deleteActivity = (businessIds: any, data: any) => {
    return request({ url: `/tienchin/business/${businessIds}`, method: "DELETE", data: data })
}


// 根据id查询商机详情
export const getIdBusinessDetails = (id: any, data: any) => {
    return request({ url: `/tienchin/business/${id}`, method: "GET", params: data })
}
